import QtQuick
import QtQuick.Layouts

Item {
    id: root

    property alias source: image.source
    property string front: ''
    readonly property string path: 'media/images/'
    readonly property string back:'media/images/card0.png'

    function fronted() {
        image.source = front
    }

    function backed() {
        image.source = back
    }

    function is_front() {
        return image.source == front
    }

    width: 85
    height: 115
    Layout.minimumWidth: width
    Layout.minimumHeight: height
    Layout.maximumWidth: width
    Layout.maximumHeight: height

    // -SHADOW-
    BorderImage {
        anchors.fill: image

        anchors {
            leftMargin: -6
            topMargin: -6
            rightMargin: -8
            bottomMargin: -8
        }

        border {
            left: 10
            top: 10
            right: 10
            bottom: 10
        }

        source: 'media/uts/shadow.png'
    }

    Image {
        id: image
        x: 0
        y: 0
        anchors.fill: parent
        source: root.back
    }
}


